package com.kitten.comment.constants;

/**
 * @author kitten
 */
public class RedisKeyConstants {

    private static final String HAVE_FIRST_REPLY_COMMENT_KEY_PREFIX = "comment:haveFirstReplyCommentId";

    public static String buildHaveFirstReplyCommentKey(Long commentId) {
        return HAVE_FIRST_REPLY_COMMENT_KEY_PREFIX + ":" + commentId;
    }
    // 笔记的评论总数
    private static final String COUNT_COMMENT_TOTAL_KEY_PREFIX = "count:note:";

    public static final String FIELD_COMMENT_TOTAL = "commentTotal";

    public static String buildNoteCommentTotalKey(Long noteId) {
        return COUNT_COMMENT_TOTAL_KEY_PREFIX + noteId;
    }
    // 笔记的热门评论id
    private static final String COMMENT_LIST_KEY_PREFIX = "comment:list:";

    public static String buildCommentListKey(Long noteId) {
        return COMMENT_LIST_KEY_PREFIX + noteId;
    }
    // 笔记的热门评论信息
    private static final String COMMENT_DETAIL_KEY_PREFIX = "comment:detail:";

    public static String buildCommentDetailKey(Object commentId) {
        return COMMENT_DETAIL_KEY_PREFIX + commentId;
    }

    // 评论计数
    private static final String COUNT_COMMENT_KEY_PREFIX = "count:comment:";
    // 子评论总数
    public static final String FIELD_CHILD_COMMENT_TOTAL = "childCommentTotal";
    // 点赞计数
    public static final String FIELD_LIKE_TOTAL = "likeTotal";

    public static String buildCommentCountKey(Long commentId) {
        return COUNT_COMMENT_KEY_PREFIX + commentId;
    }

    // 二级评论信息
    private static final String CHILD_COMMENT_LIST_KEY_PREFIX = "comment:childList:";

    public static String buildChildCommentListKey(Long commentId) {
        return CHILD_COMMENT_LIST_KEY_PREFIX + commentId;
    }

    // 评论点赞记录
    private static final String BLOOM_COMMENT_LIKES_KEY_PREFIX = "bloom:comment:likes:";

    public static String buildBloomCommentLikesKey(Long userId) {
        return BLOOM_COMMENT_LIKES_KEY_PREFIX + userId;
    }

}
